package com.homework;

import java.util.Arrays;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/29 18:14
 * @description
 */
public class T3 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        for (int i = 0; i < 5; i++) {
            int m = (int) (Math.random()*(30-15+1))+15;
            boolean flag = true;

            for (int j = 0; j < arr.length; j++) {
                if (m==arr[j]){
                    flag = false;
                }
            }
            if (flag){
                arr[i] = m;
            }else {
                i--;
            }
        }
//        System.out.println(Arrays.toString(arr));
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length; j++) {
                if (arr[i]<arr[j]){
                    int t = arr[i];
                    arr[i] = arr[j];
                    arr[j] = t;
                }
            }
        }
        for (int i : arr) {
            System.out.print(i+" ");
        }
    }
}
